package com.wanxi.feign;

import com.wanxi.entity.DoctorEntity;
import com.wanxi.entity.DoctorApply;
import com.wanxi.result.CommonResult;
import com.wanxi.vo.*;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "doctor-server",path = "/doctor")
public interface DoctorFeignClient {
    @GetMapping("/findAllFront")
    @ApiOperation(value = "前台查找医生", response = DoctorEntity.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK", response = DoctorQuery.class, responseContainer = "List")
    })
//    用来前台查找医生
    public CommonResult findAllFront(@SpringQueryMap DoctorQuery doctorFindFront);

    @GetMapping("/findAllBack")
    @ApiOperation(value = "后台查找医生", response = DoctorEntity.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK", response = DoctorFindBack.class, responseContainer = "List")
    })
    //用来后台查找医生
    public CommonResult findAllBack(@SpringQueryMap DoctorQuery doctorQuery);
    @PostMapping("/add")
    @ApiOperation(value = "添加入驻医生", response = DoctorEntity.class)
//    用来医生用户添加认证
    public CommonResult add(@RequestBody DoctorAddDTO doctorAddDTO);
    @PostMapping("/addApply")
    @ApiOperation(value = "添加入驻医生申请", response = DoctorEntity.class)
//    用来医生用户添加认证
    public CommonResult addApply(@RequestBody DoctorApplyDTO doctorApplyDTO);
    @PutMapping("/updateAuthentication")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "医生id", required = true),
    })
    @ApiOperation(value = "更新医生认证信息", response = DoctorEntity.class)
//    用来医生用户更新认证
    public CommonResult updateAuthentication(@RequestParam("id") Long id,@RequestBody DoctorAddDTO doctorAddDTO);
    @GetMapping("/findAccountStatus")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "医生id", required = true),
            @ApiImplicitParam(name = "state", value = "医生账号状态", required = true)
    })
    @ApiOperation(value = "查询医生入驻审核状态", response = DoctorAccountStatusDTO.class)
//    用来医生用户查询自己认证审核状态
    public CommonResult findAccountStatus(@RequestParam("id") long id,@RequestParam("state") Integer state);

    @PutMapping("/del")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "id", value = "医生id", required = true)
    )
    @ApiOperation(value = "停启用医生账号", response = DoctorEntity.class)
    //用来删除医生账号
    public CommonResult delete(@RequestBody DoctorStatus doctorStatus);
    @PutMapping("/updateStatus")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "医生id", required = true),
            @ApiImplicitParam(name = "state", value = "医生业务状态", required = true)
    })
    @ApiOperation(value = "更新申请状态", response = DoctorStatus.class)
    //
    public CommonResult updateStatus(@RequestBody DoctorStatus doctorStatus);
    @PutMapping("/updateFailureReason")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "申请表id", required = true),
            @ApiImplicitParam(name = "failureReason", value = "失败原因", required = true)
    })
    @ApiOperation(value = "更新失败原因", response = CommonResult.class)
//    更新失败原因
    public CommonResult updateFailureReason(@RequestParam("id") Long id,@RequestParam("failureReason") String failureReason);

    @GetMapping("/findAccountApply")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "医生id", required = true),
            @ApiImplicitParam(name = "state", value = "医生账号状态", required = true)
    })
    @ApiOperation(value = "后台查询医生入驻申请", response = DoctorApply.class)
//    用来查询医生入驻申请列表
    public CommonResult findAccountApply(@SpringQueryMap DoctorApplyQuery doctorApplyQuery);
    @GetMapping("/findAccountApplyFront")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "医生id", required = true),
            @ApiImplicitParam(name = "state", value = "医生账号状态", required = true)
    })
    @ApiOperation(value = "前台查询医生入驻申请", response = DoctorApply.class)
//    用来查询医生入驻申请列表
    public CommonResult findAccountApplyFront(@SpringQueryMap DoctorApplyQuery doctorApplyQuery);
    @ApiOperation(value = "为医生分配服务包",response = CommonResult.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "医生id", required = true),
            @ApiImplicitParam(name = "pId", value = "服务包id", required = true)
    })
    @PostMapping("/addDoctorServer")
    public CommonResult addDoctorServer(@RequestParam("id") Long id, @RequestParam("pIds")List<Long> pId);


}
